<?php
namespace app\api\controller\v1;

use app\api\controller\Home;
use think\Request;
use app\common\model\CateModel;

class Cate extends Home {
    public function index(){
        $cate = new CateModel();
        $list = $cate->paginate(1);
//        $list = $cate->select();
        return json(['code'=>1,'msg'=>'ok','data'=>$list]);
    }
    
    public function read(Request $request){
        $cid = $request->param('cid');
        $cate = new CateModel();
        $info  = $cate->find($cid);
        return json(['code'=>1,'msg'=>'ok','data'=>$info]);
    }
}

?>